<template>
	<view class="container">
		正在进入直播间...
	</view>
</template>
<script>
	import toMpWeixin from '../../js_sdk/wzc-toMpWeixin/toMpWeixin.js';
	//#ifdef H5
	import wxjs   from '../../jweixin/lib/index.js';
	//#endif
	export default {
		data() {
			return {

			}
		},
		onLoad(e) {
			this.initialize();
		},
		onShow(){
			this.initialize();
		},
		methods: {
			initialize:function() {
				uni.showToast({
					title:"正在进入直播间...",
					duration:1500000
				})
				// 注意需要在真机调试查看
				wx.getChannelsLiveInfo({
					finderUserName: '直播间ID',
					success: (res) => {
						console.log('直播间信息',res)
						wx.openChannelsLive({
							finderUserName: '直播间ID',
							feedId: res.feedId,
							nonceId: res.nonceId,
							success: (res) => {
								console.log('打开直播',res)
							}
						})
					}
				})
			}
		}
	}
</script>


